#ifndef CH_REPORTLISTVIEW_H
#define CH_REPORTLISTVIEW_H

#pragma once

#include <afxcview.h>
#include "CHReportListBase.h"
#include "CHReportListPrint.h"

class CHReportListView : public CListView, public CHReportListBase
{
	DECLARE_DYNCREATE(CHReportListView)

public:
	CHReportListView()
	{
		AttachImpl( &GetListCtrl() );
	}

	virtual ~CHReportListView() { }

	void SetExtendedStyle(DWORD dwExStyle) 
	{
		CHReportListBase::SetExtendedStyle(dwExStyle); 
	}

	DWORD GetExtendedStyle()
	{
		return CHReportListBase::GetExtendedStyle();
	}

	//{{AFX_VIRTUAL(CHReportListView)
	public:
	virtual void OnInitialUpdate();
  	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	protected:
	virtual void OnDraw(CDC* pDC);	  // overridden to draw this view
	virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
	//}}AFX_VIRTUAL

protected:
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

	//{{AFX_MSG(CHReportListView)
	afx_msg void OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnRclick(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnDestroy();
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnPaint();
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnClick(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnDblclk(NMHDR* pNMHDR, LRESULT* pResult);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

protected:
	CHReportListPrint print;
};


#endif //CH_REPORTLISTVIEW_H
